package com.peg.rules;

import com.peg.dataobjects.Context;

/**
 * @author sad
 */
public class None extends ContainerRule {

    public None(Rule... rules) {
        setRules(rules);
    }

    @Override
    public boolean execute(Context context) {
        for (Rule rule : getRules()) {
            boolean result = executeRule(rule, context);
            if (result) {
                return false;
            }
        }

        return true;
    }

    @Override
    public String toString() {
        return "None";
    }
}
